<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Windows 10上配置TexLive2019与Texmaker论文编译环境, 木千之的格物斋">
    <meta name="description" content="写在前面一般国外会议论文或者期刊论文都提供Latex模板，原因在于Latex排版得到的论文通常十分美观，尤其对于数学公式的表现更是十分漂亮，而且可以自动处理字符大小与行间距等在Word下费时费力的编辑工作，因而广受科研人员的喜爱。
虽然自己">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>Windows 10上配置TexLive2019与Texmaker论文编译环境 | 木千之的格物斋</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/css/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    <style type="text/css">
        
    </style>

    <script src="/libs/jquery/jquery-2.2.0.min.js"></script>
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>


<body>

<header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="container">
            <div class="nav-wrapper">
                <div class="brand-logo">
                    <a href="/" class="waves-effect waves-light">
                        
                        <img src="/medias/logo.png" class="logo-img hide-on-small-only">
                        
                        <span class="logo-span">木千之的格物斋</span>
                    </a>
                </div>
                

<a href="#" data-activates="mobile-nav" class="button-collapse"><i class="fa fa-navicon"></i></a>
<ul class="right">
    
    <li class="hide-on-med-and-down">
        <a href="/" class="waves-effect waves-light">
            
            <i class="fa fa-home"></i>
            
            <span>首页</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/tags" class="waves-effect waves-light">
            
            <i class="fa fa-tags"></i>
            
            <span>标签</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/categories" class="waves-effect waves-light">
            
            <i class="fa fa-bookmark"></i>
            
            <span>分类</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/archives" class="waves-effect waves-light">
            
            <i class="fa fa-archive"></i>
            
            <span>归档</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/about" class="waves-effect waves-light">
            
            <i class="fa fa-user-circle-o"></i>
            
            <span>关于</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/friends" class="waves-effect waves-light">
            
            <i class="fa fa-address-book"></i>
            
            <span>友情链接</span>
        </a>
    </li>
    
    <li>
        <a id="toggleSearch" class="waves-effect waves-light">
            <i id="searchIcon" class="mdi-action-search" title="搜索"></i>
        </a>
    </li>

</ul>

<div class="side-nav" id="mobile-nav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">木千之的格物斋</div>
        <div class="logo-desc">
            
            人，既无虎狼之爪牙，亦无狮象之力量，却能擒狼缚虎，驯狮猎象，无它，惟智慧耳。
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li>
            <a href="/" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-home"></i>
                
                首页
            </a>
        </li>
        
        <li>
            <a href="/tags" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-tags"></i>
                
                标签
            </a>
        </li>
        
        <li>
            <a href="/categories" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-bookmark"></i>
                
                分类
            </a>
        </li>
        
        <li>
            <a href="/archives" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-archive"></i>
                
                归档
            </a>
        </li>
        
        <li>
            <a href="/about" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-user-circle-o"></i>
                
                关于
            </a>
        </li>
        
        <li>
            <a href="/friends" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-address-book"></i>
                
                友情链接
            </a>
        </li>
        
        
    </ul>

    <div class="social-link">


    <a href="mailto:windhawk_wings@163.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fa fa-envelope-open"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2796418272" class="tooltipped" data-tooltip="QQ联系我: 2796418272" data-position="top" data-delay="50">
        <i class="fa fa-qq"></i>
    </a>



    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fa fa-rss"></i>
    </a>
</div>
</div>

            </div>
        </div>

        
    </nav>
</header>





<div class="bg-cover post-cover" style="background-image: url('/medias/featureimages/3.jpg')">
    <div class="container">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <div class="description center-align post-title">
                        Windows 10上配置TexLive2019与Texmaker论文编译环境
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }
</style>
<div class="row">
    <div class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/技术/" target="_blank">
                                <span class="chip bg-color">技术</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fa fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/格物致知/" class="post-category" target="_blank">
                                格物致知
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                <div class="post-date info-break-policy">
                    <i class="fa fa-calendar-minus-o fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-02-05
                </div>

                
				
				
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="fa fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h3 id="写在前面"><a href="#写在前面" class="headerlink" title="写在前面"></a>写在前面</h3><p>一般国外会议论文或者期刊论文都提供<em>Latex</em>模板，原因在于<em>Latex</em>排版得到的论文通常十分美观，尤其对于数学公式的表现更是十分漂亮，而且可以自动处理字符大小与行间距等在<em>Word</em>下费时费力的编辑工作，因而广受科研人员的喜爱。</p>
<p>虽然自己也写过几篇国外会议论文，但是使用的都是较为老旧的<em>Latex</em>编译环境，比如早已停止更新导致<em>Bug</em>不断的<em>CTex</em>，以及不容易使用的<em>Winedit</em>。</p>
<p>趁着写作毕业设计的机会，正好可以更新自己的<em>Latex</em>编译环境，这次则直接从国科大推荐的<em>TexLive</em>与<em>Texmaker</em>入手。</p>
<p>今天的这篇文章主要是自己在<em>Win10</em>上的安装配置笔记，另外还补充了测试示例与一个小问题的解决方案。大致小节有：</p>
<ul>
<li><em>TexLive的下载与安装</em></li>
<li><em>Texmaker的安装与配置</em></li>
<li><em>HelloWorld示例</em></li>
<li><em>CTex编译错误的解决</em></li>
</ul>
<hr>
<h3 id="一、TexLive的下载与安装"><a href="#一、TexLive的下载与安装" class="headerlink" title="一、TexLive的下载与安装"></a>一、<em>TexLive</em>的下载与安装</h3><p><em>TexLive</em>作为一款免费的<em>Latex</em>编译环境一直进行着维护，供广大科研人员免费使用。基本的下载方式也比较简单，首先进入<em>TexLive</em>的官网：<a href="http://tug.org/texlive/，然后依次选择其中的*How" target="_blank" rel="noopener">http://tug.org/texlive/，然后依次选择其中的*How</a> to acquire Tex Live*，其中提供三种安装方式：</p>
<ul>
<li>download：在线安装模式，点击下载后会得到一个<em>install-tl-windows.exe</em>，在线安装即可；</li>
<li>DVD：其实就是下载一个完整的iso镜像，可以离线本地安装；</li>
<li>Ohter：其他的下载方法，供特殊需要的亲们使用；</li>
</ul>
<p>一般我们选择在线<em>download</em>或者本地<em>ISO</em>即可，且具体的安装步骤设置相同，区别一可能在于时间，在线安装容易受到网络波动影响，因此时间不好估计；而本地安装需要读取ISO镜像，安装大概在30-60分钟。我采取的是本地ISO安装，下面均以此为例。首先我们需要点击进入<em>TexLive-ISO</em>的网址：<a href="http://mirrors.ustc.edu.cn/CTAN/systems/texlive/Images/，然后选择其中的文件*texlive.iso*下载即可，因为无论何种版本，*texlive.iso*始终是最新版本的镜像名称。如下图：" target="_blank" rel="noopener">http://mirrors.ustc.edu.cn/CTAN/systems/texlive/Images/，然后选择其中的文件*texlive.iso*下载即可，因为无论何种版本，*texlive.iso*始终是最新版本的镜像名称。如下图：</a></p>
<p><img src="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/Windows-10上配置TexLive2019与Texmaker论文编译环境\texlive-iso.png" alt></p>
<p>下载到本地后（迅雷大约5分钟左右，10M/s），然后<em>Win10</em>上可以直接点击打开，或者可以使用以前的虚拟镜像工具也可以，得到其中的安装脚本文件：<em>install-tl-advanced.bat</em>，批处理文件执行完毕后，会跳出安装界面：</p>
<p><img src="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/Windows-10上配置TexLive2019与Texmaker论文编译环境\1.png" alt></p>
<p>其中，一般只需要修改两点：一是<em>Installation root</em>可以自定义<em>Texlive</em>的安装位置；二是左下角的<em>Advanced</em>进行攻击定制：</p>
<p>对于我们而言，为了避免冗余的安装体积，可以去掉不必要的语言包，以及现在过时的<em>Texwork</em>编译器，因为我们后面要安装更方便的<em>Texmaker</em>：</p>
<p>然后确定后，开始安装即可，即便是本地安装，也大概需要30分钟-60分钟左右。</p>
<p><img src="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/Windows-10上配置TexLive2019与Texmaker论文编译环境\2.png" alt></p>
<p>完成后会提示<em>Welcom</em>然后关闭退出即可。<em>Texlive</em>安装成功。</p>
<hr>
<h3 id="二、TexMaker的安装与配置"><a href="#二、TexMaker的安装与配置" class="headerlink" title="二、TexMaker的安装与配置"></a>二、<em>TexMaker</em>的安装与配置</h3><p><em>TexMaker</em>也是一个方便的强大<em>Latex</em>编译器，可以去官网下载：<a href="https://www.xm1math.net/texmaker/。" target="_blank" rel="noopener">https://www.xm1math.net/texmaker/。</a></p>
<p>下载后得到本地安装包，然后安装即可。需要注意的是安装之后需要设置<em>Latex</em>编译路径：</p>
<p>点击<em>选项</em>–<em>配置Texmaker</em>，然后在第一行与第二行的<em>Latex</em>与<em>PdfLatex</em>命令路径中，分别指定自己的<em>TexLive</em>中<em>bin</em>目录下的位置即可：</p>
<p><img src="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/Windows-10上配置TexLive2019与Texmaker论文编译环境\3.png" alt></p>
<p><em>Texmaker</em>的配置也基本完成了，是不是很简单？</p>
<p>好，下面我们看一个测试示例。</p>
<hr>
<h3 id="三、HelloWorld示例"><a href="#三、HelloWorld示例" class="headerlink" title="三、HelloWorld示例"></a>三、HelloWorld示例</h3><p>程序界的一般习惯是编写一个最简单的测试脚本验证安装成功。</p>
<p>试着新建一个文件后，键入以下代码：</p>
<pre class=" language-latex"><code class="language-latex">    <span class="token function selector">\documentclass</span><span class="token punctuation">{</span><span class="token keyword">article</span><span class="token punctuation">}</span>
    <span class="token function selector">\begin</span><span class="token punctuation">{</span><span class="token keyword">document</span><span class="token punctuation">}</span>
    Hello world
    <span class="token function selector">\end</span><span class="token punctuation">{</span><span class="token keyword">document</span><span class="token punctuation">}</span>
</code></pre>
<p>然后快速构建：（注意先记得保存，否则会提示错误）</p>
<p><img src="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/Windows-10上配置TexLive2019与Texmaker论文编译环境\4.png" alt></p>
<p>得到上述结果表明安装成功！</p>
<hr>
<h3 id="四、CTex编译错误解决"><a href="#四、CTex编译错误解决" class="headerlink" title="四、CTex编译错误解决"></a>四、<em>CTex</em>编译错误解决</h3><p>虽然简单测试通过了，但是自己在编译国科大论文模板时还是出错了，错误为：</p>
<p> <strong>Critical Package ctex Error: CTeX fontset `fandol’ is unavailable in current</strong></p>
<p>自己不得其解，后来发现，可能问题出在<em>PdfLatex</em>的选择：</p>
<p>解决方法为对于<em>PdfLatex</em>的命令选择<em>xlatex</em>即可：</p>
<p><img src="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/Windows-10上配置TexLive2019与Texmaker论文编译环境\5.png" alt></p>
<p>然后问题顺利解决！</p>
<p><img src="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/Windows-10上配置TexLive2019与Texmaker论文编译环境\6.png" alt></p>
<p>以上就是自己安装的过程笔记~以后有问题再来补充！</p>

            </div>
            <hr/>

            
            <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.88rem;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff;
        background-color: #22AB38;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff;
        background-color: #019FE8;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a class="reward-link btn-floating btn-large waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close"><i class="fa fa-close"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs">
                        <li class="tab wechat-tab waves-effect waves-light"><a class="active" href="#wechat">微信</a></li>
                        <li class="tab alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                    </ul>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.png" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('#reward .reward-link').on('click', function () {
            $('#rewardModal').openModal();
        });

        $('#rewardModal .close').on('click', function () {
            $('#rewardModal').closeModal();
        });
    });
</script>
            

            <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    <div class="social-share" data-disabled="qzone" data-wechat-qrcode-helper="<p>微信里点“发现”->“扫一扫”二维码便可查看分享。</p>"></div>
    
</div>

<script src="/libs/share/js/social-share.min.js"></script>

            <div class="reprint">
                <p>
                    <span class="reprint-tip">
                        <i class="fa fa-exclamation-circle"></i>&nbsp;&nbsp;转载请注明:
                    </span>
                    <a href="http://muqianzhi.gitee.io" class="b-link-green">木千之的格物斋</a>
                    <i class="fa fa-angle-right fa-lg fa-fw text-color"></i>
                    <a href="/2020/02/05/Windows-10上配置TexLive2019与Texmaker论文编译环境/" class="b-link-green">Windows 10上配置TexLive2019与Texmaker论文编译环境</a>
                </p>
            </div>
        </div>
    </div>

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fa fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2020/02/06/2020年2月-春节再启航/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/20.jpg" class="responsive-img" alt="[2020年2月-春节再启航]">
                        
                        <span class="card-title">[2020年2月-春节再启航]</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">写在前面今年的春节不同于以往，新冠状病毒导致的肺炎疫情突然爆发，过年的喜庆祥和立刻被冲淡，剩下的只有每天不断刷新的确诊数字与宅在家里日益堆积的脂肪与昏聩。然而，从APP市场搜索打卡应用时，发现了那么多在假期就已经开始打卡努力的人们，有学生，</div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="fa fa-clock-o fa-fw icon-date"></i>2020-02-06
                        </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/青峦洗心/" class="post-category" target="_blank">
                                    青峦洗心
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/毕业之路/" target="_blank">
                        <span class="chip bg-color">毕业之路</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fa fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2020/01/16/2020年1月壹-小目标/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/0.jpg" class="responsive-img" alt="[2020年1月壹] 小目标">
                        
                        <span class="card-title">[2020年1月壹] 小目标</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">小目标写在前面自马来西亚归来，总觉得应该先调整端正心态以重新进入正常的学习工作状态，然而每次想动笔，却总是思绪万千，怕失了重点，因而迟迟拖延不敢开始。
然而，就算自己，也得承认目前缺失了十分重要的东西，我把它称之为源动力，到底自己为何而活？</div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="fa fa-clock-o fa-fw icon-date"></i>2020-01-16
                            </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/青峦洗心/" class="post-category" target="_blank">
                                    青峦洗心
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/毕业之路/" target="_blank">
                        <span class="chip bg-color">毕业之路</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>
</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('120')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: 木千之的格物斋<br />'
            + '作者: 木千之<br />'
            + '链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>

    </div>
    <div class="col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="fa fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            // headingsOffset: -205,
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });
    });
</script>
    

</main>


<footer class="page-footer bg-color">
    <div class="container row center-align">
        <div class="col s12 m8 l8 copy-right">
            本站由&copy;<a href="http://muqianzhi.gitee.io" target="_blank">木千之</a>基于
            <a href="https://hexo.io/" target="_blank">Hexo</a> 的
            <a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">hexo-theme-matery</a>主题搭建.

            

            
			
                <br>
                
                <span id="busuanzi_container_site_pv">
                    <i class="fa fa-heart-o"></i>
                    本站总访问量 <span id="busuanzi_value_site_pv" class="white-color"></span>
                </span>
                
                
                <span id="busuanzi_container_site_uv">
                    <i class="fa fa-users"></i>
                    次,&nbsp;访客数 <span id="busuanzi_value_site_uv" class="white-color"></span> 人.
                </span>
                
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">


    <a href="mailto:windhawk_wings@163.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fa fa-envelope-open"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=2796418272" class="tooltipped" data-tooltip="QQ联系我: 2796418272" data-position="top" data-delay="50">
        <i class="fa fa-qq"></i>
    </a>



    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fa fa-rss"></i>
    </a>
</div>
    </div>
</footer>

<div class="progress-bar"></div>


<!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fa fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input" autofocus="">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
</script>
<!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fa fa-angle-up"></i>
    </a>
</div>


<script src="/libs/materialize/js/materialize.min.js"></script>
<script src="/libs/masonry/masonry.pkgd.min.js"></script>
<script src="/libs/aos/aos.js"></script>
<script src="/libs/scrollprogress/scrollProgress.min.js"></script>
<script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
<script src="/js/matery.js"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->



    <script src="/libs/others/clicklove.js"></script>


    <script async src="/libs/others/busuanzi.pure.mini.js"></script>


</body>
</html>